<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no, email=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>

</head>
<body>
<script>
    function creatObj(name,age,sex,has) {
        var obj=new Object();
        obj.name=name;
        obj.age=age;
        obj.sex=sex;
        obj.has=has;
        obj.say=function(a){
            document.write(a);
        }
        return obj;
    }
    var a=creatObj("小明",18,"男","女朋友");
//    document.write(a.name +"  今年"+a.age  +"岁  性别:"+a.sex+"  有"+a.has +"  他说：")
    document.write(`${a.name}今年${a.age}岁  性别：${a.sex}   没有${a.has}   他说：`)
    a.say("“以后我会好好的！”");

</script>
</body>
</html>